package com.lanou.pianke.search.web.controller;


import com.lanou.pianke.search.entity.Piece;
import com.lanou.pianke.search.service.PieceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/es/")
@RestController
public class PieceController {

    @Autowired
    private PieceService pieceService;

    // 根据文章回复内容查评论
    @GetMapping("findByPieceContent")
    public List<Piece> findByPieceContent(String searchContent){
        return pieceService.searchByPieceContent(searchContent);
    }

}
